package org.xu.upms.client;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.util.WebUtils;

public class SessionUtils {

	private static String sessionName = "_sessionUser";
	
	public static void setSessionUser(HttpServletRequest request,SessionUser sessionUser){
		
	 	WebUtils.setSessionAttribute(request, sessionName, sessionUser);
	}
	
	public static SessionUser getSessionUser(HttpServletRequest request){
		return (SessionUser)WebUtils.getSessionAttribute(request, sessionName);
	}
	public static void invalidate(HttpServletRequest request){
		setSessionUser(request,null);
		
	}
	
}
